﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;

// Configure log4net using the .config file
[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.cfg.xml", Watch = true)]

namespace CancelBOSSOrder
{
    public class Program
    {
        // Create a logger for use in this class
        private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

        static void Main(string[] args)
        {
            //DeliverCancelOrders();
            try { ParseLogFile.GetBOSSOrders(); }
            catch (Exception ex)
            {
                log.Debug("出现异常", ex);
            }

            Console.WriteLine("处理完毕.");
            Console.Read();
        }

       

        //private static void DeliverCancelOrders()
        //{
        //    var sqlconn = new SqlConnection();
        //    sqlconn.ConnectionString = ConfigurationManager.ConnectionStrings["ECSSDb"].ConnectionString;

        //    var sqlcmd = new SqlCommand();
        //    sqlcmd.CommandText = @"select bossorderid from tempdb.dbo.ECSS2011051802";
        //    sqlcmd.Connection = sqlconn;

        //    try
        //    {
        //        sqlcmd.Connection.Open();
        //        var sqlrd = sqlcmd.ExecuteReader();
        //        while (sqlrd.Read())
        //        {
        //            var bossOrderID = sqlrd["BOSSOrderID"].ToString();
        //            CancelBOSSOrderID(bossOrderID);
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        log.Error("访问数据库异常", ex);
        //    }
        //    finally
        //    {
        //        sqlcmd.Connection.Close();
        //    }

        //}
    }
}
